package com.pluginsacceptor.plugin.formula.MathsTrigo;

import com.pluginsacceptor.plugin.formula.MathsTrigo.support.DataListener;
import com.pluginsacceptor.plugin.formula.MathsTrigo.support.DataSender;
import com.pluginsacceptor.plugin.formula.MathsTrigo.support.MathData;

public class SoustractionListenerCalcul extends AbstractListener {

	/**
     * Constructor
     * @param dataListener
     * @param dataSender
     */
    public SoustractionListenerCalcul(final DataListener dataListener, final DataSender dataSender) {
        super(dataListener, dataSender);
    }

    @Override
    protected  double calculate() {
    	final MathsTrigo mtg = new MathsTrigo();
    	final double a = MathData.silentParse(this.getUserData()[0]);
    	final double b = MathData.silentParse(this.getUserData()[1]);
    	final double result = mtg.soustraction(a, b);
		return  result;


    }
}
